/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * interfaz.java
 *
 * Created on 14/09/2012, 12:00:02 PM
 */
package interfaz;

import javax.swing.JOptionPane;

/**
 *
 * @author Isis
 */
public class principal extends javax.swing.JFrame {

    /** Creates new form interfaz */
    public principal() {
        initComponents();
        cargarLayout();
        cargarMenus();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        panelMenu = new javax.swing.JPanel();
        iconoSalir = new javax.swing.JLabel();
        iconoAyuda = new javax.swing.JLabel();
        iconoHome = new javax.swing.JLabel();
        panelAreaDeTrabajo = new javax.swing.JPanel();
        panelTareas = new javax.swing.JPanel();
        iconoConfig = new javax.swing.JLabel();
        iconoInfo = new javax.swing.JLabel();
        iconoMapa = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setAlwaysOnTop(true);

        panelMenu.setBackground(new java.awt.Color(0, 0, 0));

        iconoSalir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/delete_item.png"))); // NOI18N
        iconoAyuda.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                iconoAyudaMouseClicked(evt);
            }
        });
        iconoAyuda.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/help.png"))); // NOI18N

        iconoHome.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/home.png"))); // NOI18N
        iconoHome.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                iconoHomeMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout panelMenuLayout = new javax.swing.GroupLayout(panelMenu);
        panelMenu.setLayout(panelMenuLayout);
        panelMenuLayout.setHorizontalGroup(
            panelMenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelMenuLayout.createSequentialGroup()
                .addContainerGap(751, Short.MAX_VALUE)
                .addComponent(iconoHome)
                .addGap(29, 29, 29)
                .addComponent(iconoAyuda)
                .addGap(18, 18, 18)
                .addComponent(iconoSalir)
                .addGap(22, 22, 22))
        );
        panelMenuLayout.setVerticalGroup(
            panelMenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelMenuLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelMenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(iconoHome)
                    .addGroup(panelMenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(iconoAyuda, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(iconoSalir, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap(21, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout panelAreaDeTrabajoLayout = new javax.swing.GroupLayout(panelAreaDeTrabajo);
        panelAreaDeTrabajo.setLayout(panelAreaDeTrabajoLayout);
        panelAreaDeTrabajoLayout.setHorizontalGroup(
            panelAreaDeTrabajoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 916, Short.MAX_VALUE)
        );
        panelAreaDeTrabajoLayout.setVerticalGroup(
            panelAreaDeTrabajoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 427, Short.MAX_VALUE)
        );

        panelTareas.setBackground(new java.awt.Color(0, 0, 0));

        iconoConfig.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/tool.png"))); // NOI18N
        iconoConfig.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                iconoConfigMouseClicked(evt);
            }
        });

        iconoSalir.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                iconoSalirMouseClicked(evt);
            }
        });
        
        iconoInfo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/info.png"))); // NOI18N
        iconoInfo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                iconoInfoMouseClicked(evt);
            }
        });

        iconoMapa.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/map.png"))); // NOI18N
        iconoMapa.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                iconoMapaMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout panelTareasLayout = new javax.swing.GroupLayout(panelTareas);
        panelTareas.setLayout(panelTareasLayout);
        panelTareasLayout.setHorizontalGroup(
            panelTareasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelTareasLayout.createSequentialGroup()
                .addContainerGap(646, Short.MAX_VALUE)
                .addComponent(iconoMapa)
                .addGap(27, 27, 27)
                .addComponent(iconoConfig)
                .addGap(42, 42, 42)
                .addComponent(iconoInfo)
                .addGap(41, 41, 41))
        );
        panelTareasLayout.setVerticalGroup(
            panelTareasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelTareasLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelTareasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(iconoMapa)
                    .addComponent(iconoInfo)
                    .addComponent(iconoConfig))
                .addContainerGap(51, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panelMenu, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(panelAreaDeTrabajo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(panelTareas, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(panelTareas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(panelAreaDeTrabajo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panelMenu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>

    public static void iconoConfigMouseClicked(java.awt.event.MouseEvent evt) {
    System.out.println("si");
        interfaz.configuracion panelConfiguracion=new interfaz.configuracion();
    panelConfiguracion.setBounds(0, 0,
            interfaz.variables.anchoAreaDeTrabajo,interfaz.variables.altoAreaDeTrabajo);
    panelAreaDeTrabajo.removeAll();
    panelAreaDeTrabajo.add(panelConfiguracion);
    panelAreaDeTrabajo.setVisible(false);
    panelAreaDeTrabajo.setVisible(true);
   
    }

    private void iconoHomeMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        interfaz.inicio panelInicio=new interfaz.inicio();
    panelInicio.setBounds(0, 0,
            interfaz.variables.anchoAreaDeTrabajo,interfaz.variables.altoAreaDeTrabajo);
    this.panelAreaDeTrabajo.removeAll();
    this.panelAreaDeTrabajo.add(panelInicio);
    this.panelAreaDeTrabajo.setVisible(false);
    this.panelAreaDeTrabajo.setVisible(true);
    }
    
        public static void iconoAyudaMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        interfaz.ayuda panelAyuda=new interfaz.ayuda();
    panelAyuda.setBounds(0, 0,
            interfaz.variables.anchoAreaDeTrabajo,interfaz.variables.altoAreaDeTrabajo);
    panelAreaDeTrabajo.removeAll();
    panelAreaDeTrabajo.add(panelAyuda);
    panelAreaDeTrabajo.setVisible(false);
    panelAreaDeTrabajo.setVisible(true);
    }

    private void iconoInfoMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
              interfaz.info panelInfo=new interfaz.info();
    panelInfo.setBounds(0, 0,
            interfaz.variables.anchoAreaDeTrabajo,interfaz.variables.altoAreaDeTrabajo);
    this.panelAreaDeTrabajo.removeAll();
    this.panelAreaDeTrabajo.add(panelInfo);
    this.panelAreaDeTrabajo.setVisible(false);
    this.panelAreaDeTrabajo.setVisible(true);
    }

    public static void iconoMapaMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    interfaz.mapa panelMapa=new interfaz.mapa();
    panelMapa.setBounds(0, 0,
            interfaz.variables.anchoAreaDeTrabajo,interfaz.variables.altoAreaDeTrabajo);
    panelAreaDeTrabajo.removeAll();
    panelAreaDeTrabajo.add(panelMapa);
    panelAreaDeTrabajo.setVisible(false);
    panelAreaDeTrabajo.setVisible(true); 
    }
    
    private void iconoSalirMouseClicked(java.awt.event.MouseEvent evt) {
   int i =JOptionPane.showConfirmDialog(this,"¿Realmente Desea Salir?","Confirmar Salida",JOptionPane.YES_NO_OPTION);
        if(i==0){
        System.exit(0);
        }  
    }
    
    /**
     * Metodo que configura el Layout de la aplicacion
     */
    public void cargarLayout()
    {
    this.setLayout(null);        
    this.setSize(interfaz.variables.anchoFrame,interfaz.variables.altoFrame);
    
    
    this.panelTareas.setLayout(null);
     this.panelTareas.setBounds(interfaz.variables.TareasX, interfaz.variables.TareasY,
            interfaz.variables.anchoTareas,interfaz.variables.altoTareas);
    
    this.panelMenu.setLayout(null);
      this.panelMenu.setBounds(interfaz.variables.MenuX, interfaz.variables.Menuy,
            interfaz.variables.anchoMenu,interfaz.variables.altoMenu);
    
    this.panelAreaDeTrabajo.setLayout(null);   
    this.panelAreaDeTrabajo.setBounds(interfaz.variables.AreaDeTrabajoX, interfaz.variables.AreaDeTrabajoY,
            interfaz.variables.anchoAreaDeTrabajo,interfaz.variables.altoAreaDeTrabajo);
    }
    
    
    
    /**
     * Cargar menus al iniciar la aplicacion
     */
    public void cargarMenus()
    {
    interfaz.inicio panelInicio=new interfaz.inicio();
    panelInicio.setBounds(0, 0,
            interfaz.variables.anchoAreaDeTrabajo,interfaz.variables.altoAreaDeTrabajo);
    this.panelAreaDeTrabajo.add(panelInicio);
    
    this.iconoSalir.setBounds(interfaz.variables.iconoSalirX, interfaz.variables.iconoSalirY,
            interfaz.variables.tamIcono,interfaz.variables.tamIcono);
    
    this.iconoAyuda.setBounds(interfaz.variables.iconoAyudaX, interfaz.variables.iconoAyudaY,
            interfaz.variables.tamIcono,interfaz.variables.tamIcono);
    
     this.iconoHome.setBounds(interfaz.variables.iconoHomeX, interfaz.variables.iconoHomeY,
            interfaz.variables.tamIcono,interfaz.variables.tamIcono);
     
     this.iconoConfig.setBounds(interfaz.variables.iconoConfigX, interfaz.variables.iconoConfigY,
            interfaz.variables.tamIconoGrande,interfaz.variables.tamIconoGrande);
     
     this.iconoInfo.setBounds(interfaz.variables.iconoInfoX, interfaz.variables.iconoInfoY,
            interfaz.variables.tamIconoGrande,interfaz.variables.tamIconoGrande);
     
          this.iconoMapa.setBounds(interfaz.variables.iconoMapaX, interfaz.variables.iconoMapaY,
            interfaz.variables.tamIconoGrande,interfaz.variables.tamIconoGrande);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new principal().setVisible(true);
            }
        });
    }
    
    public static void anularIcono(javax.swing.JLabel icono)
    {
        icono.setVisible(false);
    }
    
     public static void activarIcono(javax.swing.JLabel icono)
    {
        icono.setVisible(true);
    }
    
    // Variables declaration - do not modify
    public static javax.swing.JLabel iconoAyuda;
    public static javax.swing.JLabel iconoConfig;
    public static javax.swing.JLabel iconoHome;
    public static javax.swing.JLabel iconoInfo;
    public static javax.swing.JLabel iconoMapa;
    public static javax.swing.JLabel iconoSalir;
    public static javax.swing.JPanel panelAreaDeTrabajo;
    public static javax.swing.JPanel panelMenu;
    public static javax.swing.JPanel panelMenu1;
    public static javax.swing.JPanel panelTareas;
    // End of variables declaration
}
